/**
 * 
 */
package com.sci.web.action.eninfomanager;

import javax.annotation.Resource;

import com.googlecode.jsonplugin.annotations.JSON;
import com.sci.web.action.util.BaseAction;
import com.sci.web.bean.Enterprise_Base;
import com.sci.web.dao.UserRegisterDao;

/**
 * @author BaiFuyou
 * @date: Oct 13, 2011 11:19:09 AM
 * 企业信息 更改
 * 更新企业的信息
 */
public class UpdateEnterpriseInfoAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6437116895884868814L;
	@Resource
	private UserRegisterDao registerdao;
	private int userid;
	private boolean success;
	private int enterpriseid;
	private String user_name;
	private String user_pwd;
	private String user_mail;
	private String enterprise_address;
	private String enterprise_name;
	private int enterprise_city;
	private String enterprise_post_code;
	private String enterprise_corporate_code;
	private String enterprise_corporateRepresentative;
	private String enterprise_telephone;
	private String enterprise_person_incharge;
	private String enterprise_phone_incharge;
	private String enterprise_business_field;
	private String enterprise_major_business;
	private int enterprise_eco_type;
	private int enterprise_org_type;
	private String enterprise_largest_sharehoder;
	private float enterprise_largest_share;
	private int enterprise_listed_type;
	private int enterprise_industry_code;
	private int enterprise_credit_degree;
	private int enterprise_science_type;
	private int enterprise_staff_count;
	private int enterprise_staff_collegedegree_count;
	private int enterprise_research_staff_count;
	private int enterprise_senior_technician_count;
	private int enterprise_field_closeness;


	/**
	 * @return the user_name
	 */
	@JSON(serialize = false)
	public String getUser_name() {
		return user_name;
	}

	/**
	 * @param user_name
	 *            the user_name to set
	 */
	public void setUser_name(String user_name) {
		this.user_name = user_name;
	}

	/**
	 * @return the user_pwd
	 */
	@JSON(serialize = false)
	public String getUser_pwd() {
		return user_pwd;
	}

	/**
	 * @param user_pwd
	 *            the user_pwd to set
	 */
	public void setUser_pwd(String user_pwd) {
		this.user_pwd = user_pwd;
	}

	/**
	 * @return the user_mail
	 */
	@JSON(serialize = false)
	public String getUser_mail() {
		return user_mail;
	}

	/**
	 * @param user_mail
	 *            the user_mail to set
	 */
	public void setUser_mail(String user_mail) {
		this.user_mail = user_mail;
	}

	/**
	 * @return the enterprise_address
	 */
	@JSON(serialize = false)
	public String getEnterprise_address() {
		return enterprise_address;
	}

	/**
	 * @param enterprise_address
	 *            the enterprise_address to set
	 */
	public void setEnterprise_address(String enterprise_address) {
		this.enterprise_address = enterprise_address;
	}

	/**
	 * @return the enterprise_name
	 */
	@JSON(serialize = false)
	public String getEnterprise_name() {
		return enterprise_name;
	}

	/**
	 * @param enterprise_name
	 *            the enterprise_name to set
	 */
	public void setEnterprise_name(String enterprise_name) {
		this.enterprise_name = enterprise_name;
	}

	/**
	 * @return the enterprise_city
	 */
	@JSON(serialize = false)
	public int getEnterprise_city() {
		return enterprise_city;
	}

	/**
	 * @param enterprise_city
	 *            the enterprise_city to set
	 */
	public void setEnterprise_city(int enterprise_city) {
		this.enterprise_city = enterprise_city;
	}

	/**
	 * @return the enterprise_post_code
	 */
	@JSON(serialize = false)
	public String getEnterprise_post_code() {
		return enterprise_post_code;
	}

	/**
	 * @param enterprise_post_code
	 *            the enterprise_post_code to set
	 */
	public void setEnterprise_post_code(String enterprise_post_code) {
		this.enterprise_post_code = enterprise_post_code;
	}

	/**
	 * @return the enterprise_corporate_code
	 */
	@JSON(serialize = false)
	public String getEnterprise_corporate_code() {
		return enterprise_corporate_code;
	}

	/**
	 * @param enterprise_corporate_code
	 *            the enterprise_corporate_code to set
	 */
	public void setEnterprise_corporate_code(String enterprise_corporate_code) {
		this.enterprise_corporate_code = enterprise_corporate_code;
	}

	/**
	 * @return the enterprise_corporateRepresentative
	 */
	@JSON(serialize = false)
	public String getEnterprise_corporateRepresentative() {
		return enterprise_corporateRepresentative;
	}

	/**
	 * @param enterprise_corporateRepresentative
	 *            the enterprise_corporateRepresentative to set
	 */
	public void setEnterprise_corporateRepresentative(String enterprise_corporateRepresentative) {
		this.enterprise_corporateRepresentative = enterprise_corporateRepresentative;
	}

	/**
	 * @return the enterprise_telephone
	 */
	@JSON(serialize = false)
	public String getEnterprise_telephone() {
		return enterprise_telephone;
	}

	/**
	 * @param enterprise_telephone
	 *            the enterprise_telephone to set
	 */
	public void setEnterprise_telephone(String enterprise_telephone) {
		this.enterprise_telephone = enterprise_telephone;
	}

	/**
	 * @return the enterprise_person_incharge
	 */
	@JSON(serialize = false)
	public String getEnterprise_person_incharge() {
		return enterprise_person_incharge;
	}

	/**
	 * @param enterprise_person_incharge
	 *            the enterprise_person_incharge to set
	 */
	public void setEnterprise_person_incharge(String enterprise_person_incharge) {
		this.enterprise_person_incharge = enterprise_person_incharge;
	}

	/**
	 * @return the enterprise_phone_incharge
	 */
	@JSON(serialize = false)
	public String getEnterprise_phone_incharge() {
		return enterprise_phone_incharge;
	}

	/**
	 * @param enterprise_phone_incharge
	 *            the enterprise_phone_incharge to set
	 */
	public void setEnterprise_phone_incharge(String enterprise_phone_incharge) {
		this.enterprise_phone_incharge = enterprise_phone_incharge;
	}

	/**
	 * @return the enterprise_business_field
	 */
	@JSON(serialize = false)
	public String getEnterprise_business_field() {
		return enterprise_business_field;
	}

	/**
	 * @param enterprise_business_field
	 *            the enterprise_business_field to set
	 */
	public void setEnterprise_business_field(String enterprise_business_field) {
		this.enterprise_business_field = enterprise_business_field;
	}

	/**
	 * @return the enterprise_major_business
	 */
	@JSON(serialize = false)
	public String getEnterprise_major_business() {
		return enterprise_major_business;
	}

	/**
	 * @param enterprise_major_business
	 *            the enterprise_major_business to set
	 */
	public void setEnterprise_major_business(String enterprise_major_business) {
		this.enterprise_major_business = enterprise_major_business;
	}

	/**
	 * @return the enterprise_eco_type
	 */
	@JSON(serialize = false)
	public int getEnterprise_eco_type() {
		return enterprise_eco_type;
	}

	/**
	 * @param enterprise_eco_type
	 *            the enterprise_eco_type to set
	 */
	public void setEnterprise_eco_type(int enterprise_eco_type) {
		this.enterprise_eco_type = enterprise_eco_type;
	}

	/**
	 * @return the enterprise_org_type
	 */
	@JSON(serialize = false)
	public int getEnterprise_org_type() {
		return enterprise_org_type;
	}

	/**
	 * @param enterprise_org_type
	 *            the enterprise_org_type to set
	 */
	public void setEnterprise_org_type(int enterprise_org_type) {
		this.enterprise_org_type = enterprise_org_type;
	}

	/**
	 * @return the enterprise_largest_sharehoder
	 */
	@JSON(serialize = false)
	public String getEnterprise_largest_sharehoder() {
		return enterprise_largest_sharehoder;
	}

	/**
	 * @param enterprise_largest_sharehoder
	 *            the enterprise_largest_sharehoder to set
	 */
	public void setEnterprise_largest_sharehoder(String enterprise_largest_sharehoder) {
		this.enterprise_largest_sharehoder = enterprise_largest_sharehoder;
	}

	/**
	 * @return the enterprise_largest_share
	 */
	@JSON(serialize = false)
	public float getEnterprise_largest_share() {
		return enterprise_largest_share;
	}

	/**
	 * @param enterprise_largest_share
	 *            the enterprise_largest_share to set
	 */
	public void setEnterprise_largest_share(float enterprise_largest_share) {
		this.enterprise_largest_share = enterprise_largest_share;
	}

	/**
	 * @return the enterprise_listed_type
	 */
	@JSON(serialize = false)
	public int getEnterprise_listed_type() {
		return enterprise_listed_type;
	}

	/**
	 * @param enterprise_listed_type
	 *            the enterprise_listed_type to set
	 */
	public void setEnterprise_listed_type(int enterprise_listed_type) {
		this.enterprise_listed_type = enterprise_listed_type;
	}

	/**
	 * @return the enterprise_industry_code
	 */
	@JSON(serialize = false)
	public int getEnterprise_industry_code() {
		return enterprise_industry_code;
	}

	/**
	 * @param enterprise_industry_code
	 *            the enterprise_industry_code to set
	 */
	public void setEnterprise_industry_code(int enterprise_industry_code) {
		this.enterprise_industry_code = enterprise_industry_code;
	}

	/**
	 * @return the enterprise_credit_degree
	 */
	@JSON(serialize = false)
	public int getEnterprise_credit_degree() {
		return enterprise_credit_degree;
	}

	/**
	 * @param enterprise_credit_degree
	 *            the enterprise_credit_degree to set
	 */
	public void setEnterprise_credit_degree(int enterprise_credit_degree) {
		this.enterprise_credit_degree = enterprise_credit_degree;
	}

	/**
	 * @return the enterprise_science_type
	 */
	@JSON(serialize = false)
	public int getEnterprise_science_type() {
		return enterprise_science_type;
	}

	/**
	 * @param enterprise_science_type
	 *            the enterprise_science_type to set
	 */
	public void setEnterprise_science_type(int enterprise_science_type) {
		this.enterprise_science_type = enterprise_science_type;
	}

	/**
	 * @return the enterprise_staff_count
	 */
	@JSON(serialize = false)
	public int getEnterprise_staff_count() {
		return enterprise_staff_count;
	}

	/**
	 * @param enterprise_staff_count
	 *            the enterprise_staff_count to set
	 */
	public void setEnterprise_staff_count(int enterprise_staff_count) {
		this.enterprise_staff_count = enterprise_staff_count;
	}

	/**
	 * @return the enterprise_staff_collegedegree_count
	 */
	@JSON(serialize = false)
	public int getEnterprise_staff_collegedegree_count() {
		return enterprise_staff_collegedegree_count;
	}

	/**
	 * @param enterprise_staff_collegedegree_count
	 *            the enterprise_staff_collegedegree_count to set
	 */
	public void setEnterprise_staff_collegedegree_count(int enterprise_staff_collegedegree_count) {
		this.enterprise_staff_collegedegree_count = enterprise_staff_collegedegree_count;
	}

	/**
	 * @return the enterprise_research_staff_count
	 */
	@JSON(serialize = false)
	public int getEnterprise_research_staff_count() {
		return enterprise_research_staff_count;
	}

	/**
	 * @param enterprise_research_staff_count
	 *            the enterprise_research_staff_count to set
	 */
	public void setEnterprise_research_staff_count(int enterprise_research_staff_count) {
		this.enterprise_research_staff_count = enterprise_research_staff_count;
	}

	/**
	 * @return the enterprise_senior_technician_count
	 */
	@JSON(serialize = false)
	public int getEnterprise_senior_technician_count() {
		return enterprise_senior_technician_count;
	}

	/**
	 * @param enterprise_senior_technician_count
	 *            the enterprise_senior_technician_count to set
	 */
	public void setEnterprise_senior_technician_count(int enterprise_senior_technician_count) {
		this.enterprise_senior_technician_count = enterprise_senior_technician_count;
	}

	/**
	 * @return the enterprise_field_closeness
	 */
	@JSON(serialize = false)
	public int getEnterprise_field_closeness() {
		return enterprise_field_closeness;
	}

	/**
	 * @param enterprise_field_closeness
	 *            the enterprise_field_closeness to set
	 */
	public void setEnterprise_field_closeness(int enterprise_field_closeness) {
		this.enterprise_field_closeness = enterprise_field_closeness;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		Enterprise_Base eb = new Enterprise_Base();
		eb.setEnterprise_updateinfo(enterpriseid);
		System.out.println("enterpriseid====="+enterpriseid);
		/**
		 * 正在审核
		 */
		eb.setEnterprise_updatestatus(1);
		eb.setEnterprise_name(enterprise_name);
		eb.setEnterprise_address(enterprise_address);
		eb.setEnterprise_corporate_code(enterprise_corporate_code);
		eb.setEnterprise_city(enterprise_city);
		eb.setEnterprise_postcode(enterprise_post_code);
		eb.setEnterprise_corporateRepresentative(enterprise_corporateRepresentative);
		eb.setEnterprise_telephone(enterprise_telephone);
		eb.setEnterprise_person_incharge(enterprise_person_incharge);
		eb.setEnterprise_phone_incharge(enterprise_phone_incharge);
		eb.setEnterprise_eco_type(enterprise_eco_type);
		eb.setEnterprise_org_type(enterprise_org_type);
		eb.setEnterprise_largest_sharehoder(enterprise_largest_sharehoder);
		eb.setEnterprise_largest_share(enterprise_largest_share);
		eb.setEnterprise_listed_type(enterprise_listed_type);
		eb.setEnterprise_science_type(enterprise_science_type);
		eb.setEnterprise_industry_code(enterprise_industry_code);
		eb.setEnterprise_highsci_field(enterprise_science_type+"");
		eb.setEnterprise_credit_degree(enterprise_credit_degree);
		eb.setEnterprise_business_field(enterprise_business_field);
		eb.setEnterprise_field_closeness(enterprise_field_closeness);
		eb.setEnterprise_major_business(enterprise_major_business);
		eb.setEnterprise_staff_count(enterprise_staff_count);
		eb.setEnterprise_staff_collegedegree_count(enterprise_staff_collegedegree_count);
		eb.setEnterprise_research_staff_count(enterprise_research_staff_count);
		eb.setEnterprise_senior_technician_count(enterprise_senior_technician_count);
		eb.setEnterprise_url("nourl");
		eb.setEnterprise_pic("nopic");
		eb.setUser_id(0);
		System.out.println(eb);
		
		if (registerdao.insertUpdateEnterpriseInfo(eb)) {
			this.setSuccess(true);
		} else {
			this.setSuccess(false);
		}
		return "json";
	}

	/**
	 * @return the success
	 */
	public boolean isSuccess() {
		return success;
	}

	/**
	 * @param success
	 *            the success to set
	 */
	public void setSuccess(boolean success) {
		this.success = success;
	}

	/**
	 * @return the enterpriseid
	 */
	public int getEnterpriseid() {
		return enterpriseid;
	}

	/**
	 * @param enterpriseid the enterpriseid to set
	 */
	public void setEnterpriseid(int enterpriseid) {
		this.enterpriseid = enterpriseid;
	}

	/**
	 * @return the userid
	 */
	public int getUserid() {
		return userid;
	}

	/**
	 * @param userid the userid to set
	 */
	public void setUserid(int userid) {
		this.userid = userid;
	}
}
